package com.alphasystem.commerce.common.service.sequence;

import com.alphasystem.commerce.common.ApplicationException;
import com.alphasystem.commerce.common.model.sequence.Sequence;

/**
 * @author Syed Farhan Ali
 * 
 */
public interface SequenceService {

	/**
	 * @param entity
	 */
	public void createSequence(Sequence entity);

	/**
	 * @param name
	 * @param initial
	 * @param blockSize
	 * @param prefix
	 * @param suffix
	 */
	public void createSequence(String name, long initial, long blockSize,
			String prefix, String suffix);

	/**
	 * @param name
	 * @return
	 * @throws ApplicationException
	 */
	public Long getNextLongSequenceNumber(String name)
			throws ApplicationException;

	/**
	 * @param name
	 * @return
	 * @throws ApplicationException
	 * @throws Exception
	 */
	public String getNextSequenceNumber(String name)
			throws ApplicationException;

	/**
	 * @param klass
	 * @return
	 */
	@SuppressWarnings("rawtypes")
	public String getSequenceName(Class klass);

	/**
	 * @param name
	 * @param initial
	 * @param blockSize
	 * @param prefix
	 * @param suffix
	 */
	public void updateSequence(String name, long initial, long blockSize,
			String prefix, String suffix);

}
